package com.yilin.tms.core.entity.order.payment;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.entity.capital.TradeRecord;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "order_refund_cost")
@TableName(value = "order_refund_cost")
public class OrderRefundCost extends BaseDataEntity {

   /**
    * 支付状态
    */
   public enum RefundStatus {
      verify(0, "审核中"),//付款审批中
      fail(1, "失败"),//付款审批失败，不允许付款
      approved(2, "已审批，等待付款"),//付款审批完成
      wait(3, "等待中"),//付款已通过，即将付款
      success(4, "付款成功");//付款完成

      @EnumValue
      public Integer index;
      public String name;

      RefundStatus(Integer index, String name) {
         this.index = index;
         this.name = name;
      }
   }
   //货主
   @Column(name = "shipper_account_id")
   private String shipperAccountId;//货主账号
   @Column(name = "shipper_account_name")
   private String shipperAccountName;//
   @Column(name = "shipper_organize_id")
   private String shipperOrganizeId;//
   @Column(name = "shipper_organize_name")
   private String shipperOrganizeName;//
   //实际退款小计
   @Column(name = "refund_insurance_cost")
   private Double refundInsuranceCost = 0D; //【实际退款】保费
   @Column(name = "refund_additional_cost")
   private Double refundAdditionalCost = 0D; //【实际退款】附加费
   @Column(name = "refund_transport_cost")
   private Double refundTransportCost = 0D; //【实际退款】运输费
   @Column(name = "refund_tax_cost")
   private Double refundTaxCost = 0D; //【实际退款】税费
   @Column(name = "refund_shipper_fee_cost")
   private Double refundShipperFeeCost = 0D; //【实际退款】手续费
   //----实退
   @Column(name = "refund_cost")
   private Double refundCost = 0D;  // 【实际退款】费用合计
   //理论费用
   @Column(name = "should_insurance_cost")
   private Double shouldInsuranceCost = 0D; //【理论费用】保费
   @Column(name = "should_additional_cost")
   private Double shouldAdditionalCost = 0D; //【理论费用】附加费
   @Column(name = "should_transport_cost")
   private Double shouldTransportCost = 0D; //【理论费用】运输费
   @Column(name = "should_tax_cost")
   private Double shouldTaxCost = 0D; //【理论费用】税费
   @Column(name = "should_shipper_fee_cost")
   private Double shouldShipperFeeCost = 0D; //【理论费用】手续费
   @Column(name = "should_pay_cost")
   private Double shouldPayCost;//【争议费用】
   //原始费用小计
   @Column(name = "original_insurance_cost")
   private Double originalInsuranceCost = 0D; //【原始费用】保费
   @Column(name = "original_additional_cost")
   private Double originalAdditionalCost = 0D; //【原始费用】附加费
   @Column(name = "original_transport_cost")
   private Double originalTransportCost = 0D; //【原始费用】运输费
   @Column(name = "original_tax_cost")
   private Double originalTaxCost = 0D; //【原始费用】税费
   @Column(name = "original_shipper_fee_cost")
   private Double originalShipperFeeCost = 0D; //【原始费用】手续费
   @Column(name = "original_pay_cost")
   private Double originalPayCost;//【原始费用】
   //原交易单
   @Column(name = "original_payment_id")
   private String originalPaymentId;
   @Column(name = "original_pay_status")
   private OrderPaymentCost.PayStatus originalPayStatus;
   @Column(name = "original_trade_no")
   private String originalTradeNo;
   @Column(name = "original_bank_flow_no")
   private String originalBankFlowNo;
   @Column(name = "original_payment_capital_account")
   private String originalPaymentCapitalAccount;//原付款资金账号/卡号/微信ID/支付宝ID 等
   @Column(name = "original_income_capital_account")
   private String originalIncomeCapitalAccount;//原收款资金账号/卡号/微信ID/支付宝ID 等
   // 时间线
   @Column(name = "refund_create_time")
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
   private Date refundCreateTime;
   @Column(name = " refund_complete_time")
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
   private Date  refundCompleteTime;
   // 基本数据
   @Column(name = "pre_payment_no")
   private String prePaymentNo ;//预付单号
   @Column(name = "refund_status")
   private RefundStatus refundStatus;//退款状态
   @Column(name = "refund_type")
   private TradeRecord.PayType refundType;//退款方式 原路
   @Column(name = "trade_no")
   private String tradeNo;//退款单号(平台流水号)
   @Column(name = "refund_remark")
   private String refundRemark;//退款说明
   // 退款操作人
   @Column(name = "verify_user_id")
   @TableField(fill = FieldFill.UPDATE)
   private String verifyUserId;//审核操作人ID
   @Column(name = "verify_user_name")
   @TableField(fill = FieldFill.UPDATE)
   private String verifyUserName;//审核操作人名称
   @Column(name = "lock_time")
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
   private Date lockTime;//审核锁定时间
   @Column(name = "initiate_user_id")
   private String initiateUserId;//退款发起人 创建交易包
   @Column(name = "initiate_user_name")
   private String initiateUserName;//退款发起人名称
   @Column(name = "opt_user_id")
   private String optUserId;//退款操作人ID
   @Column(name = "opt_user_name")
   private String optUserName;//退款操作人名称
   // 第三方支付数据
   @Column(name = "payment_safe_code")
   private String paymentSafeCode;//新增安全码，用于通知结果时验证支付结果安全
   @Column(name = "bank_flow_no")
   private String bankFlowNo;//银行退款流水号（银行/第三方)
   @Column(name = "payment_capital_account")
   private String paymentCapitalAccount;//付款资金账号 = originalIncomeCapitalAccount
   @Column(name = "income_capital_account")
   private String incomeCapitalAccount;//收款资金账号 = originalPaymentCapitalAccount
   @Column(name = "payment_type_name")
   private String paymentTypeName;//支付银行/平台名称

   public String getPaymentTypeName() {
      return paymentTypeName;
   }

   public void setPaymentTypeName(String paymentTypeName) {
      this.paymentTypeName = paymentTypeName;
   }

   public String getVerifyUserId() {
      return verifyUserId;
   }

   public void setVerifyUserId(String verifyUserId) {
      this.verifyUserId = verifyUserId;
   }

   public String getVerifyUserName() {
      return verifyUserName;
   }

   public void setVerifyUserName(String verifyUserName) {
      this.verifyUserName = verifyUserName;
   }

   public String getPrePaymentNo() {
      return prePaymentNo;
   }

   public void setPrePaymentNo(String prePaymentNo) {
      this.prePaymentNo = prePaymentNo;
   }

   public String getShipperAccountId() {
      return shipperAccountId;
   }

   public void setShipperAccountId(String shipperAccountId) {
      this.shipperAccountId = shipperAccountId;
   }

   public String getShipperAccountName() {
      return shipperAccountName;
   }

   public void setShipperAccountName(String shipperAccountName) {
      this.shipperAccountName = shipperAccountName;
   }

   public String getShipperOrganizeId() {
      return shipperOrganizeId;
   }

   public void setShipperOrganizeId(String shipperOrganizeId) {
      this.shipperOrganizeId = shipperOrganizeId;
   }

   public String getShipperOrganizeName() {
      return shipperOrganizeName;
   }

   public void setShipperOrganizeName(String shipperOrganizeName) {
      this.shipperOrganizeName = shipperOrganizeName;
   }

   public String getPaymentSafeCode() {
      return paymentSafeCode;
   }

   public void setPaymentSafeCode(String paymentSafeCode) {
      this.paymentSafeCode = paymentSafeCode;
   }

   public Double getShouldInsuranceCost() {
      return shouldInsuranceCost;
   }

   public void setShouldInsuranceCost(Double shouldInsuranceCost) {
      this.shouldInsuranceCost = shouldInsuranceCost;
   }

   public Double getShouldAdditionalCost() {
      return shouldAdditionalCost;
   }

   public void setShouldAdditionalCost(Double shouldAdditionalCost) {
      this.shouldAdditionalCost = shouldAdditionalCost;
   }

   public Double getShouldTransportCost() {
      return shouldTransportCost;
   }

   public void setShouldTransportCost(Double shouldTransportCost) {
      this.shouldTransportCost = shouldTransportCost;
   }

   public Double getShouldTaxCost() {
      return shouldTaxCost;
   }

   public void setShouldTaxCost(Double shouldTaxCost) {
      this.shouldTaxCost = shouldTaxCost;
   }

   public Double getShouldShipperFeeCost() {
      return shouldShipperFeeCost;
   }

   public void setShouldShipperFeeCost(Double shouldShipperFeeCost) {
      this.shouldShipperFeeCost = shouldShipperFeeCost;
   }

   public Double getShouldPayCost() {
      return shouldPayCost;
   }

   public void setShouldPayCost(Double shouldPayCost) {
      this.shouldPayCost = shouldPayCost;
   }

   public OrderPaymentCost.PayStatus getOriginalPayStatus() {
      return originalPayStatus;
   }

   public void setOriginalPayStatus(OrderPaymentCost.PayStatus originalPayStatus) {
      this.originalPayStatus = originalPayStatus;
   }

   public Date getLockTime() {
      return lockTime;
   }

   public void setLockTime(Date lockTime) {
      this.lockTime = lockTime;
   }

   public String getInitiateUserId() {
      return initiateUserId;
   }

   public void setInitiateUserId(String initiateUserId) {
      this.initiateUserId = initiateUserId;
   }

   public String getInitiateUserName() {
      return initiateUserName;
   }

   public void setInitiateUserName(String initiateUserName) {
      this.initiateUserName = initiateUserName;
   }

   public String getBankFlowNo() {
      return bankFlowNo;
   }

   public void setBankFlowNo(String bankFlowNo) {
      this.bankFlowNo = bankFlowNo;
   }

   public String getPaymentCapitalAccount() {
      return paymentCapitalAccount;
   }

   public void setPaymentCapitalAccount(String paymentCapitalAccount) {
      this.paymentCapitalAccount = paymentCapitalAccount;
   }

   public String getIncomeCapitalAccount() {
      return incomeCapitalAccount;
   }

   public void setIncomeCapitalAccount(String incomeCapitalAccount) {
      this.incomeCapitalAccount = incomeCapitalAccount;
   }

   public Double getRefundInsuranceCost() {
      return refundInsuranceCost;
   }

   public void setRefundInsuranceCost(Double refundInsuranceCost) {
      this.refundInsuranceCost = refundInsuranceCost;
   }

   public Double getRefundAdditionalCost() {
      return refundAdditionalCost;
   }

   public void setRefundAdditionalCost(Double refundAdditionalCost) {
      this.refundAdditionalCost = refundAdditionalCost;
   }

   public Double getRefundTransportCost() {
      return refundTransportCost;
   }

   public void setRefundTransportCost(Double refundTransportCost) {
      this.refundTransportCost = refundTransportCost;
   }


   public Double getRefundShipperFeeCost() {
      return refundShipperFeeCost;
   }

   public void setRefundShipperFeeCost(Double refundShipperFeeCost) {
      this.refundShipperFeeCost = refundShipperFeeCost;
   }

   public Double getRefundCost() {
      return refundCost;
   }

   public void setRefundCost(Double refundCost) {
      this.refundCost = refundCost;
   }

   public Double getOriginalPayCost() {
      return originalPayCost;
   }

   public void setOriginalPayCost(Double originalPayCost) {
      this.originalPayCost = originalPayCost;
   }

   public Double getOriginalInsuranceCost() {
      return originalInsuranceCost;
   }

   public void setOriginalInsuranceCost(Double originalInsuranceCost) {
      this.originalInsuranceCost = originalInsuranceCost;
   }

   public Double getOriginalAdditionalCost() {
      return originalAdditionalCost;
   }

   public void setOriginalAdditionalCost(Double originalAdditionalCost) {
      this.originalAdditionalCost = originalAdditionalCost;
   }

   public Double getOriginalTransportCost() {
      return originalTransportCost;
   }

   public void setOriginalTransportCost(Double originalTransportCost) {
      this.originalTransportCost = originalTransportCost;
   }

   public Double getRefundTaxCost() {
      return refundTaxCost;
   }

   public void setRefundTaxCost(Double refundTaxCost) {
      this.refundTaxCost = refundTaxCost;
   }

   public Double getOriginalTaxCost() {
      return originalTaxCost;
   }

   public void setOriginalTaxCost(Double originalTaxCost) {
      this.originalTaxCost = originalTaxCost;
   }

   public Double getOriginalShipperFeeCost() {
      return originalShipperFeeCost;
   }

   public void setOriginalShipperFeeCost(Double originalShipperFeeCost) {
      this.originalShipperFeeCost = originalShipperFeeCost;
   }

   public String getOriginalPaymentId() {
      return originalPaymentId;
   }

   public void setOriginalPaymentId(String originalPaymentId) {
      this.originalPaymentId = originalPaymentId;
   }

   public String getOriginalTradeNo() {
      return originalTradeNo;
   }

   public void setOriginalTradeNo(String originalTradeNo) {
      this.originalTradeNo = originalTradeNo;
   }

   public String getOriginalBankFlowNo() {
      return originalBankFlowNo;
   }

   public void setOriginalBankFlowNo(String originalBankFlowNo) {
      this.originalBankFlowNo = originalBankFlowNo;
   }

   public String getOriginalPaymentCapitalAccount() {
      return originalPaymentCapitalAccount;
   }

   public void setOriginalPaymentCapitalAccount(String originalPaymentCapitalAccount) {
      this.originalPaymentCapitalAccount = originalPaymentCapitalAccount;
   }

   public String getOriginalIncomeCapitalAccount() {
      return originalIncomeCapitalAccount;
   }

   public void setOriginalIncomeCapitalAccount(String originalIncomeCapitalAccount) {
      this.originalIncomeCapitalAccount = originalIncomeCapitalAccount;
   }

   public Date getRefundCreateTime() {
      return refundCreateTime;
   }

   public void setRefundCreateTime(Date refundCreateTime) {
      this.refundCreateTime = refundCreateTime;
   }

   public Date getRefundCompleteTime() {
      return refundCompleteTime;
   }

   public void setRefundCompleteTime(Date refundCompleteTime) {
      this.refundCompleteTime = refundCompleteTime;
   }

   public RefundStatus getRefundStatus() {
      return refundStatus;
   }

   public void setRefundStatus(RefundStatus refundStatus) {
      this.refundStatus = refundStatus;
   }

   public TradeRecord.PayType getRefundType() {
      return refundType;
   }

   public void setRefundType(TradeRecord.PayType refundType) {
      this.refundType = refundType;
   }

   public String getTradeNo() {
      return tradeNo;
   }

   public void setTradeNo(String tradeNo) {
      this.tradeNo = tradeNo;
   }

   public String getRefundRemark() {
      return refundRemark;
   }

   public void setRefundRemark(String refundRemark) {
      this.refundRemark = refundRemark;
   }

   public String getOptUserId() {
      return optUserId;
   }

   public void setOptUserId(String optUserId) {
      this.optUserId = optUserId;
   }

   public String getOptUserName() {
      return optUserName;
   }

   public void setOptUserName(String optUserName) {
      this.optUserName = optUserName;
   }
}
